package com.joysuch.wwyt.mh.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;


public enum PeriodUnitEnum {

    MONTH("月"),
    DAY("天"),
    WEEK("周"),
    HOUR("小时"),
    MINUTE("分钟");

    private String value;

    PeriodUnitEnum(String value) {
        this.value = value;
    }

    public final String getValue() {
        return value;
    }


    private static final Map<String, PeriodUnitEnum> lookup = new HashMap<>();

    static {
        for (PeriodUnitEnum e : EnumSet.allOf(PeriodUnitEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static PeriodUnitEnum find(String value) {
        return lookup.get(value);
    }
}
